from sqlalchemy import Column, Integer, String, DECIMAL, Text, SmallInteger

from .base import BaseModel


class GoodsInfoDo(BaseModel):
    __tablename__ = "goods_info"
    __table_args__ = (
        {"comment": "goods信息"},
    )
    goods_id = Column( Integer,primary_key=True,autoincrement=True,comment="商品id")
    goods_no = Column(String(50), comment="商品编号")
    goods_name = Column(String(200), comment="商品名称")
    selling_point = Column(String(1000), default="", comment="商品卖点")
    spec_type = Column(Integer, nullable=False, comment="规格类型(10: 单规格商品, 20: 多规格商品)")
    goods_price_min = Column(DECIMAL(10, 2), nullable=False, comment="最低售价")
    goods_price_max = Column(DECIMAL(10, 2), nullable=False, comment="最高售价")
    line_price_min = Column(DECIMAL(10, 2), nullable=False, comment="最低划线价")
    line_price_max = Column(DECIMAL(10, 2), nullable=False, comment="最高划线价")
    content = Column(Text, comment="商品介绍（富文本）")
    delivery_id = Column(Integer, nullable=False, comment="配送方式ID")
    is_points_gift = Column(Integer, nullable=False, default=0, comment="是否积分赠品(1=是,0=否)")
    catalog_id = Column(Integer, comment="所属分类id")
    weight = Column(DECIMAL(18, 4), comment="重量")
    status = Column(SmallInteger, comment="上架状态:0-下架,1-上架")
    goods_sales = Column(Integer, nullable=False, default=0, comment="商品销量")
    goods_image_id = Column(String(255), default="", comment="图片ids")
    brand_id = Column(Integer, comment="品牌id")
    after_sales_service = Column(String(1000), default="", comment="售后服务")
